/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ec.gob.magap.era.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Javier
 */
@Entity
@Table(name = "AUDITORIADETALLE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Auditoriadetalle.findAll", query = "SELECT a FROM Auditoriadetalle a"),
    @NamedQuery(name = "Auditoriadetalle.findById", query = "SELECT a FROM Auditoriadetalle a WHERE a.id = :id")})
public class Auditoriadetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Lob
    @Column(name = "VALORANTERIOR")
    private String valoranterior;
    @Lob
    @Column(name = "VALORNUEVO")
    private String valornuevo;
    @JoinColumn(name = "IDAUDITORIA", referencedColumnName = "ID")
    @ManyToOne
    private Auditoria idauditoria;

    public Auditoriadetalle() {
    }

    public Auditoriadetalle(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getValoranterior() {
        return valoranterior;
    }

    public void setValoranterior(String valoranterior) {
        this.valoranterior = valoranterior;
    }

    public String getValornuevo() {
        return valornuevo;
    }

    public void setValornuevo(String valornuevo) {
        this.valornuevo = valornuevo;
    }

    public Auditoria getIdauditoria() {
        return idauditoria;
    }

    public void setIdauditoria(Auditoria idauditoria) {
        this.idauditoria = idauditoria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Auditoriadetalle)) {
            return false;
        }
        Auditoriadetalle other = (Auditoriadetalle) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ec.gob.magap.era.entities.Auditoriadetalle[ id=" + id + " ]";
    }
    
}
